# -*- coding:utf-8 -*-
# @Time:2023/6/2 20:17
# @Author: cevent

import time
from celery import Celery

# 配置消息存放容器redis(在10号库)
brokerUrl = "redis://:cevent619Rs@192.168.139.129:6379/10"
backEnd = "redis://:cevent619Rs@192.168.139.129:6379/11"

celeryDemo = Celery('celery_demo', broker=brokerUrl, backend=backEnd)


@celeryDemo.task(name='addDemo')
def add(x, y):
    print('tasks-demo loading ...')
    time.sleep(5)
    return x + y
